<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function (form) {
					cancelSelect();
					form.submit();
				},
				errorClass: 'validation-invalid-label',
				highlight: function(element, errorClass) {
					$(element).removeClass(errorClass);
				},
				errorPlacement: function (error, element) {
					validateErrorPlacement(error, element);
				}
			});
		});
	</script>
</head>
<body>
	<div class="content">
		<div class="card">
			<div class="card-body">
				<form:form id="inputForm" method="post" target="mainFrame"
						   modelAttribute="dict" action="${ctxAdmin}/sys/dict/save" >
					<form:hidden path="id"/>
					<sys:message content="${message}"/>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">分类:</label>
						<div class="col-sm-8">
							<form:input path="category" htmlEscape="false" maxlength="50" cssClass="required abc form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">键值:</label>
						<div class="col-sm-8">
							<form:input path="value" htmlEscape="false" maxlength="50" cssClass="required form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">标签:</label>
						<div class="col-sm-8">
							<form:input path="label" htmlEscape="false" maxlength="50" cssClass="required form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">类型:</label>
						<div class="col-sm-8">
							<form:input path="type" htmlEscape="false" maxlength="50" cssClass="required abc form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">描述:</label>
						<div class="col-sm-8">
							<form:input path="description" htmlEscape="false" maxlength="50" cssClass="required form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">排序:</label>
						<div class="col-sm-8">
							<form:input path="sort" htmlEscape="false" maxlength="11" cssClass="required digits form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-3 col-form-label">备注:</label>
						<div class="col-sm-8">
							<form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" cssClass="form-control"/>
						</div>
					</div>
					<div class="form-group row">
						<div class="col-sm-9 ml-auto">
							<shiro:hasPermission name="sys:dict:edit">
								<button type="submit" class="btn btn-primary"><i class="icon-database-check mr-2"></i>保 存</button>
							</shiro:hasPermission>
							<button type="button" class="btn btn-light" onclick="cancelSelect()" ><i class="icon-database-arrow mr-2"></i>取 消</button>
						</div>
					</div>
				</form:form>
			</div>
		</div>
	</div>
</body>
</html>